package apache;

import com.google.gson.Gson;

import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class Solved {

	public static void main(String[] args) {
		Map<List<Solve>, String> map = new TreeMap<>(( o1, o2) ->CharSequence.compare(o1.toString(), o2.toString()));

		List<Solve> lk = new LinkedList<>();

		lk.add(new Solve(0.0, 13.3) );
		lk.add(new Solve(25.0, 32.4) );
		lk.add(new Solve(100.0, 246.0) );
		map.put(lk, "KNO3");

		List<Solve> bo = new LinkedList<>();

		bo.add(new Solve(0.0, 0.1089) );
		bo.add(new Solve(25.0, 0.502) );
		bo.add(new Solve(100.0, 1.066) );
		map.put(bo, "Ca(OH)2");
		
		List<Solve> nc = new LinkedList<>();
		nc.add(new Solve(0.0, 35.7) );
		nc.add(new Solve(25.0, 36) );
		nc.add(new Solve(100.0, 39.8) );
		map.put(nc, "NaCl");

		try {
			FileWriter write = new FileWriter("soved.json");
			write.write(new Gson().toJson(map, Map.class));
			write.flush();
			write.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
